package com.navi.loaddata.core.gpEntity;

import com.alibaba.fastjson.annotation.JSONField;
import com.navi.loaddata.core.entity.BaseEntity;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "wpp_asht_ope_his", schema = "sor", catalog = "qmstst")
@IdClass(WppAshtOpeHisPK.class)
public class WppAshtOpeHis extends BaseEntity implements Serializable{
    private String glassId;
    private Integer prodKeyFk;
    private String prodId;
    private String owner;
    private String lotId;
    private String grade;
    private String opeId;
    private Integer opeKeyFk;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Timestamp logonTimestamp;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Timestamp logofTimestamp;
    private String evtUser;
    private String eqptId;
    private String unitEq;
    private String recipeId;
    private Integer position;
    private String productSpecversion;
    private String carrierName;
    private Integer reworkCount;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Timestamp etlTimestamp;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Timestamp mesTimestamp;
    private String etlEventNode;
    private String etlEventName;
    private Date caldDate;
//    private Integer caldKeyFk;
//    private Integer shfKeyFk;
    private String shfId;
    private Integer hourKeyFk;
//    private Integer hourId;

    @Id
    @Column(name = "glass_id")
    public String getGlassId() {
        return glassId;
    }

    public void setGlassId(String glassId) {
        this.glassId = glassId;
    }

    @Basic
    @Column(name = "prod_key_fk")
    public Integer getProdKeyFk() {
        return prodKeyFk;
    }

    public void setProdKeyFk(Integer prodKeyFk) {
        this.prodKeyFk = prodKeyFk;
    }
    @Basic
    @Column(name = "mes_timestamp")
    public Timestamp getMesTimestamp() {
        return mesTimestamp;
    }

    public void setMesTimestamp(Timestamp mesTimestamp) {
        this.mesTimestamp = mesTimestamp;
    }

    @Basic
    @Column(name = "prod_id")
    public String getProdId() {
        return prodId;
    }

    public void setProdId(String prodId) {
        this.prodId = prodId;
    }

    @Basic
    @Column(name = "owner")
    public String getOwner() {
        return owner;
    }

    public void setOwner(String owner) {
        this.owner = owner;
    }

    @Basic
    @Column(name = "lot_id")
    public String getLotId() {
        return lotId;
    }

    public void setLotId(String lotId) {
        this.lotId = lotId;
    }

    @Basic
    @Column(name = "grade")
    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    @Id
    @Column(name = "ope_id")
    public String getOpeId() {
        return opeId;
    }

    public void setOpeId(String opeId) {
        this.opeId = opeId;
    }

    @Basic
    @Column(name = "ope_key_fk")
    public Integer getOpeKeyFk() {
        return opeKeyFk;
    }

    public void setOpeKeyFk(Integer opeKeyFk) {
        this.opeKeyFk = opeKeyFk;
    }

    @Basic
    @Column(name = "logon_timestamp")
    public Timestamp getLogonTimestamp() {
        return logonTimestamp;
    }

    public void setLogonTimestamp(Timestamp logonTimestamp) {
        this.logonTimestamp = logonTimestamp;
    }

    @Id
    @Column(name = "logof_timestamp")
    public Timestamp getLogofTimestamp() {
        return logofTimestamp;
    }

    public void setLogofTimestamp(Timestamp logofTimestamp) {
        this.logofTimestamp = logofTimestamp;
    }

    @Basic
    @Column(name = "evt_user")
    public String getEvtUser() {
        return evtUser;
    }

    public void setEvtUser(String evtUser) {
        this.evtUser = evtUser;
    }

    @Basic
    @Column(name = "eqpt_id")
    public String getEqptId() {
        return eqptId;
    }

    public void setEqptId(String eqptId) {
        this.eqptId = eqptId;
    }

    @Basic
    @Column(name = "unit_eq")
    public String getUnitEq() {
        return unitEq;
    }

    public void setUnitEq(String unitEq) {
        this.unitEq = unitEq;
    }

    @Basic
    @Column(name = "recipe_id")
    public String getRecipeId() {
        return recipeId;
    }

    public void setRecipeId(String recipeId) {
        this.recipeId = recipeId;
    }

    @Basic
    @Column(name = "position")
    public Integer getPosition() {
        return position;
    }

    public void setPosition(Integer position) {
        this.position = position;
    }

    @Basic
    @Column(name = "product_specversion")
    public String getProductSpecversion() {
        return productSpecversion;
    }

    public void setProductSpecversion(String productSpecversion) {
        this.productSpecversion = productSpecversion;
    }

    @Basic
    @Column(name = "carrier_name")
    public String getCarrierName() {
        return carrierName;
    }

    public void setCarrierName(String carrierName) {
        this.carrierName = carrierName;
    }

    @Basic
    @Column(name = "rework_count")
    public Integer getReworkCount() {
        return reworkCount;
    }

    public void setReworkCount(Integer reworkCount) {
        this.reworkCount = reworkCount;
    }

    @Basic
    @Column(name = "etl_timestamp")
    public Timestamp getEtlTimestamp() {
        return etlTimestamp;
    }

    public void setEtlTimestamp(Timestamp etlTimestamp) {
        this.etlTimestamp = etlTimestamp;
    }

    @Basic
    @Column(name = "etl_event_node")
    public String getEtlEventNode() {
        return etlEventNode;
    }

    public void setEtlEventNode(String etlEventNode) {
        this.etlEventNode = etlEventNode;
    }

    @Basic
    @Column(name = "etl_event_name")
    public String getEtlEventName() {
        return etlEventName;
    }

    public void setEtlEventName(String etlEventName) {
        this.etlEventName = etlEventName;
    }

    @Basic
    @Column(name = "cald_date")
    @JSONField(format = "yyyy-MM-dd")
    public Date getCaldDate() {
        return caldDate;
    }

    public void setCaldDate(Date caldDate) {
        this.caldDate = caldDate;
    }

//    @Basic
//    @Column(name = "cald_key_fk")
//    public Integer getCaldKeyFk() {
//        return caldKeyFk;
//    }
//
//    public void setCaldKeyFk(Integer caldKeyFk) {
//        this.caldKeyFk = caldKeyFk;
//    }

//    @Basic
//    @Column(name = "shf_key_fk")
//    public Integer getShfKeyFk() {
//        return shfKeyFk;
//    }
//
//    public void setShfKeyFk(Integer shfKeyFk) {
//        this.shfKeyFk = shfKeyFk;
//    }

    @Basic
    @Column(name = "shf_id")
    public String getShfId() {
        return shfId;
    }

    public void setShfId(String shfId) {
        this.shfId = shfId;
    }

    @Basic
    @Column(name = "hour_key_fk")
    public Integer getHourKeyFk() {
        return hourKeyFk;
    }

    public void setHourKeyFk(Integer hourKeyFk) {
        this.hourKeyFk = hourKeyFk;
    }

//    @Basic
//    @Column(name = "hour_id")
//    public Integer getHourId() {
//        return hourId;
//    }
//
//    public void setHourId(Integer hourId) {
//        this.hourId = hourId;
//    }


    @Override
    public int hashCode() {
        int result = glassId != null ? glassId.hashCode() : 0;
        result = 31 * result + (prodKeyFk != null ? prodKeyFk.hashCode() : 0);
        result = 31 * result + (prodId != null ? prodId.hashCode() : 0);
        result = 31 * result + (owner != null ? owner.hashCode() : 0);
        result = 31 * result + (lotId != null ? lotId.hashCode() : 0);
        result = 31 * result + (grade != null ? grade.hashCode() : 0);
        result = 31 * result + (opeId != null ? opeId.hashCode() : 0);
        result = 31 * result + (opeKeyFk != null ? opeKeyFk.hashCode() : 0);
        result = 31 * result + (logonTimestamp != null ? logonTimestamp.hashCode() : 0);
        result = 31 * result + (logofTimestamp != null ? logofTimestamp.hashCode() : 0);
        result = 31 * result + (evtUser != null ? evtUser.hashCode() : 0);
        result = 31 * result + (eqptId != null ? eqptId.hashCode() : 0);
        result = 31 * result + (unitEq != null ? unitEq.hashCode() : 0);
        result = 31 * result + (recipeId != null ? recipeId.hashCode() : 0);
        result = 31 * result + (position != null ? position.hashCode() : 0);
        result = 31 * result + (productSpecversion != null ? productSpecversion.hashCode() : 0);
        result = 31 * result + (carrierName != null ? carrierName.hashCode() : 0);
        result = 31 * result + (reworkCount != null ? reworkCount.hashCode() : 0);
        result = 31 * result + (etlTimestamp != null ? etlTimestamp.hashCode() : 0);
        result = 31 * result + (mesTimestamp != null ? mesTimestamp.hashCode() : 0);
        result = 31 * result + (etlEventNode != null ? etlEventNode.hashCode() : 0);
        result = 31 * result + (etlEventName != null ? etlEventName.hashCode() : 0);
        result = 31 * result + (caldDate != null ? caldDate.hashCode() : 0);
//        result = 31 * result + (caldKeyFk != null ? caldKeyFk.hashCode() : 0);
//        result = 31 * result + (shfKeyFk != null ? shfKeyFk.hashCode() : 0);
        result = 31 * result + (shfId != null ? shfId.hashCode() : 0);
        result = 31 * result + (hourKeyFk != null ? hourKeyFk.hashCode() : 0);
//        result = 31 * result + (hourId != null ? hourId.hashCode() : 0);
        return result;
    }
}
